package sdcncsi.ict.counter;

import java.util.Date;

public class VisitRecord {
	private int appID;		//应用ID
	private String counterID;	//计数ID
	private String referer;	//引用页url
	private String ip;		//IP地址
	private String uv;		//UniqueVisitor标识
	private String os;		//操作系统字符串
	private String browser;	//浏览器字符串
	private long timestamp = System.currentTimeMillis();
	/**
	 * 构造方法
	 */
	public VisitRecord(int appID, String counterID, String referer, String ip, String uv, String os, String browser) {
		super();
		this.appID = appID;
		this.counterID = counterID;
		this.referer = referer;
		this.ip = ip;
		this.uv = uv;
		this.os = os;
		this.browser = browser;
	}
	/**
	 * getters and setters方法
	 */
	public int getAppID() {
		return appID;
	}
	public void setAppID(int appID) {
		this.appID = appID;
	}
	public String getCounterID() {
		return counterID;
	}
	public void setCounterID(String counterID) {
		this.counterID = counterID;
	}
	public String getReferer() {
		return referer;
	}
	public void setReferer(String referer) {
		this.referer = referer;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public String getUv() {
		return uv;
	}
	public void setUv(String uv) {
		this.uv = uv;
	}
	public String getOs() {
		return os;
	}
	public void setOs(String os) {
		this.os = os;
	}
	public String getBrowser() {
		return browser;
	}
	public void setBrowser(String browser) {
		this.browser = browser;
	}
	public long getTimestamp() {
		return timestamp;
	}
	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}
	/**
	 * toString()
	 */
	public String toString(){
		StringBuffer strBuf = new StringBuffer(2048);
		strBuf.append((new Date(timestamp)).toString()+" ");
		strBuf.append("访问[应用："+appID+"->计数ID："+counterID+"]");
		strBuf.append("访客"+uv+"来自"+ip+"引用网页"+referer);
		strBuf.append("使用"+os+"系统"+browser+"浏览器");
		return strBuf.toString();
	}
	
}
